#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int main(int argc, char *argv[])
{
    if(argc<2)
    {
        printf("input the float data to convert\n");
        return 0;
    }

    float dataInf = atof(argv[1]);


    unsigned char * ptr = (unsigned char *)(&dataInf);


    printf("data hex:%02x,%02x,%02x,%02x\n",
    ptr[0]&0x00ff,ptr[1]&0x00ff,ptr[2]&0x00ff,ptr[3]&0x00ff);

    unsigned int sum = 0x01;
    sum += ptr[0];
    sum += ptr[1];
    sum += ptr[2];
    sum += ptr[3];

    printf("sum:%02x\n",sum&0x00ff);

    return 1;
}